package twoD.IsoPfem;

import twoD.IsoPfem.math.FunctionRToR;
import inf.jlinalg.MatrixFormat;

public class EdgeLoad {
	private Node n1_;
	private Node n2_;
	private IEdge e_;
	private FunctionRToR f_;

	public EdgeLoad(Node n1, Node n2, FunctionRToR load) {
		n1_ = n1;
		n2_ = n2;
		f_ = load;
	}

	public EdgeLoad(IEdge e, FunctionRToR load) {
		n1_ = e.getN1();
		n2_ = e.getN2();
		e_ = e;
		f_ = load;
	}

	public void setLoad(FunctionRToR load) {
		f_ = load;
	}

	public FunctionRToR getLoad() {
		return f_;
	}

	public Node getN1() {
		return n1_;
	}

	public Node getN2() {
		return n2_;
	}

	public IEdge getEdge() {
		return e_;
	}

	public void printPosition() {
		System.out.print(MatrixFormat.format(this.n1_.getPosition()));
		System.out.print(MatrixFormat.format(this.n2_.getPosition()));
	}

	public void print() {
		this.printPosition();
	}
}
